<!DOCTYPE html>
<html>
<head>
    <title>Events</title>

    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet">

    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.web.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
</head>
<body>
    <a class="offline-button" href="../index.html">Back</a>
    
        <div id="example" class="k-content">        
            <div class="demo-section">            
                <ul id="menu">
                    <li>
                        First Item
                        <ul>
                            <li>Sub Item 1</li>
                            <li>Sub Item 2</li>
                            <li>Sub Item 3</li>
                            <li>Sub Item 4</li>
                        </ul>
                    </li>
                    <li>
                        Second Item
                        <ul>
                            <li>Sub Item 1</li>
                            <li>Sub Item 2</li>
                            <li>Sub Item 3</li>
                            <li>Sub Item 4</li>
                        </ul>
                    </li>
                    <li>
                        Third Item
                        <ul>
                            <li>Sub Item 1</li>
                            <li>Sub Item 2</li>
                            <li>Sub Item 3</li>
                            <li>Sub Item 4</li>
                        </ul>
                    </li>
                    <li>
                        Fourth Item
                        <ul>
                            <li>Sub Item 1</li>
                            <li>Sub Item 2</li>
                            <li>Sub Item 3</li>
                            <li>Sub Item 4</li>
                        </ul>
                    </li>
                    <li>
                        Fifth Item
                        <ul>
                            <li>Sub Item 1</li>
                            <li>Sub Item 2</li>
                            <li>Sub Item 3</li>
                            <li>Sub Item 4</li>
                        </ul>
                    </li>
                </ul>
            </div>
            <div class="demo-section">
                <h3 class="title">Console log
                </h3>
                <div class="console"></div>
            </div>
        </div>
        <script>
            $(document).ready(function() {
                function onOpen(e) {
                    kendoConsole.log("Opened: " + $(e.item).children(".k-link").text());
                }

                function onClose(e) {
                    kendoConsole.log("Closed: " + $(e.item).children(".k-link").text());
                }

                function onSelect(e) {
                    kendoConsole.log("Selected: " + $(e.item).children(".k-link").text());
                }

                function onActivate(e) {
                    kendoConsole.log("Activated: " + $(e.item).children(".k-link").text());
                }

                function onDeactivate(e) {
                    kendoConsole.log("Deactivated: " + $(e.item).children(".k-link").text());
                }

                $("#menu").kendoMenu({
                    select: onSelect,
                    open: onOpen,
                    close: onClose,
                    activate: onActivate,
                    deactivate: onDeactivate
                });
            });
        </script>


</body>
</html>
